<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<script type="text/javascript" src="highslide/highslide-with-gallery.js"></script>
<link rel="stylesheet" type="text/css" href="highslide/highslide.css" />

<script type="text/javascript">
	hs.graphicsDir = 'highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.wrapperClassName = 'dark borderless floating-caption';
	hs.fadeInOut = true;
	hs.dimmingOpacity = .75;
	hs.showCredits = false;

	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .6,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});
</script>



<?php
include 'init.php';
include "./include/membersite_config.php";

if(!$fgmembersite->CheckLogin())
{
    $fgmembersite->RedirectToURL("index.php");
    exit;
}

if (!isset($_GET['album_id']) || empty($_GET['album_id']) || album_check($_GET['album_id']) === false) {
  header('Location: albums.php');
  exit();
}

include 'template/header.php';

$album_id = $_GET['album_id'];
$album_data = album_data($album_id, 'name', 'description');

echo '<h3>', $album_data['name'], '</h3><p>', $album_data['description'], '</p>';

$album_id = $_GET['album_id'];

$images = get_images($album_id);

?>


<script type="text/javascript">
        <!--
           function confirmation(id) {
	         var answer = confirm("Do you want to delete this?")
	        if (answer){
	           window.location = "delete_image?image_id="+id;
	        }
	       
}

</script>


</head>

<body>

<!--
	3) Put the thumbnails inside a div for styling
-->
<div class="highslide-gallery">

<?php
if (empty($images)) {
	echo 'There are no images in this album';
	
} else {
	foreach ($images as $image) {
	  echo '<a href="uploads/', $image['album'], '/', $image['id'], '.', $image['ext'], '" 
	           class="highslide" onclick="return hs.expand(this)">
	         <img src="uploads/thumbs/', $image['album'], '/', $image['id'], '.', $image['ext'], '" 
	              alt="Highslide JS" title="Uploaded ', date('D M Y / h:i', $image['timestamp']), '" />
	        </a> 
	        [<a href="edit_image?album_id=', $image['album'], '&Eimage_id=', $image['id'], '">Edit</a>]
	        <input type="image" src="highslide/graphics/close.png" onclick="confirmation(',$image['id'],')" value="Delete">
	        <div class="highslide-caption"> Keywords: &nbsp', $image['keywords'],' </div>';
	}
	//print_r('uploads/'.$album_id.'/'.$image_id.'.'.$image_ext);
}

?>

</div>

<?php
include 'template/footer.php';
?>

</body>
</html>
